﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
	String path = request.getContextPath();
	String basePath = "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<base href="/">
<!-- 下拉框 -->
<link rel="stylesheet" href="static/ace/css/chosen.css" />
<!-- jsp文件头和头部 -->
<%@ include file="../../system/index/top.jsp"%>
<!-- 日期框 -->
<link rel="stylesheet" href="static/ace/css/datepicker.css" />
</head>
<body class="no-skin">

	<!-- /section:basics/navbar.layout -->
	<div class="main-container" id="main-container">
		<!-- /section:basics/sidebar -->
		<div class="main-content">
			<div class="main-content-inner">
				<div class="page-content">
					<div class="row">
						<div class="col-xs-12">
							<!-- 检索  -->
							 <form action="areagoodscount/goViewG" method="post" name="areagoodscountForm"
								id="areagoodscountForm"> 
								<input type="hidden" name="id" id="id" value="${pd.id }" /> 
								<input type="hidden" name="areaGoodState" id="areaGoodState" value="${pd.areaGoodState }" /> 

								<!-- 检索  -->
								<div id="zhongxin" style="padding-top: 13px;">
								<table id="simple-table"
									class="table table-striped table-bordered table-hover"
									style="margin-top: 5px;">
									<thead>
										<tr>
											<!-- <th class="center" style="width: 35px;"><label
												class="pos-rel"><input type="checkbox" class="ace"
													id="zcheckbox" /><span class="lbl"></span></label></th> -->
											<th class="center">编号</th>
											<th class="center">用户ID</th>
											<th class="center">是否绑定</th>
										</tr>
									</thead>
									<tbody>

										<!-- 开始循环 -->
										<c:choose>
											<c:when test="${not empty goodDetailList}">
												<c:if test="${QX.cha == 1 }">
													<c:forEach items="${goodDetailList}" var="goodDetail"
														varStatus="vs">
														<tr>
															<td class='center' style="width: 30px;">${goodDetail.areaGoodsId}</td>
															<td class="center">${goodDetail.userId }</td>
															<td class="center">
																<c:if test="${goodDetail.isBinding=='00'}">未绑定</c:if>
																<c:if test="${goodDetail.isBinding=='01'}">已绑定</c:if>
															</td>
														</tr>
													</c:forEach>
												</c:if>
												<c:if test="${QX.cha == 0 }">
													<tr>
														<td colspan="100" class="center">您无权查看</td>
													</tr>
												</c:if>
											</c:when>
											<c:otherwise>
												<tr class="main_info">
													<td colspan="100" class="center">没有相关数据</td>
												</tr>
											</c:otherwise>
										</c:choose>
									</tbody>
								</table>
								<div class="page-header position-relative">
									<table style="width: 100%;">
										<tr>
											<td style="vertical-align: top;">
												<c:if test="${QX.del == 1 }">
												<c:if test="${pd.areaGoodState=='00'}">
													<a title="删除" class="btn btn-mini btn-danger" onclick="delGoodDetails();">
														<i class='ace-icon fa fa-trash-o bigger-120'></i>
													</a>
												</c:if>
												</c:if>
											</td>
											<td style="vertical-align: top;">
												<div class="pagination" style="float: right; padding-top: 0px; margin-top: 0px;">${page.pageStr}</div>
											</td>
										</tr>
									</table>
								</div>
								</div>
								<div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><img src="static/images/jiazai.gif" /><br/><h4 class="lighter block green"></h4></div>
							</form>
						</div>
						<!-- /.col -->
					</div>
					<!-- /.row -->
				</div>
				<!-- /.page-content -->
			</div>
		</div>
		<!-- /.main-content -->
		<!-- 返回顶部 -->
		<a href="#" id="btn-scroll-up"
			class="btn-scroll-up btn btn-sm btn-inverse"> <i
			class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
		</a>
	</div>
	<!-- /.main-container -->
	<!-- basic scripts -->
	<!-- 页面底部js¨ -->
	<%@ include file="../../system/index/foot.jsp"%>
	<!-- 删除时确认窗口 -->
	<script src="static/ace/js/bootbox.js"></script>
	<!-- ace scripts -->
	<script src="static/ace/js/ace/ace.js"></script>
	<!-- 日期框 -->
	<script src="static/ace/js/date-time/bootstrap-datepicker.js"></script>
	<!-- 下拉框 -->
	<script src="static/ace/js/chosen.jquery.js"></script>
	<!--提示框-->
	<script type="text/javascript" src="static/js/jquery.tips.js"></script>
</body>
<script type="text/javascript">
		$(top.hangge());
		
		//检索
		function searchs(){
			top.jzts();
			$("#areagoodscountForm").submit();
		}
		
		//批量删除
		function delGoodDetails(){
			var id = $.trim($("#id").val());
			bootbox.prompt({
			    title: "请输入删除数量",
			    inputType: 'number',
			    callback: function (result) {
			    	if(result){
			    		if(parseInt(result)==NaN||parseInt(result)<=0){
			    			alert("请输入删除数据的数量必须为数字且大于0");
			    			return false;
			    		}
			    		if(parseInt(result)>99999){
			    			alert("每次删除数据的数量不能大于99999");
			    			return false;
			    		}
			    		$.ajax({
							type: "POST",
							scriptCharset: 'utf-8',
							url: '<%=basePath%>areagoodscount/deleteGoodDetails.do?tm='+new Date().getTime(),
					    	data: {delNum:result,id:id},
							success: function(data){
								if(data==""){
									alert("删除成功");
								}else if(data=="failed"){
									alert("删除失败");
								}else{
									alert(data);
								}
								nextPage('${page.currentPage}'); 
							}
						});
			    	}
			    }
			});
	}
</script>
</html>
